#ifndef MAIN_H
#define MAIN_H

#include <stdbool.h>
#include "tcp_server.h"
#include "serial.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>

#define NUM_PORTS 8
#define BUFFER_SIZE 4096

typedef struct
{
    int port;
    const char *serial_device;
    int baud_rate;
    int data_bits;
    int stop_bits;
    int parity;
    bool flow_control;  // 硬件流控制---不支持
} PortConfig;

extern PortConfig port_configs[NUM_PORTS];

void start_server();

#endif // MAIN_H